export const chartSetConfig = {
  // 图表响应式变化
  selfAdaption: (event) => {
    window.addEventListener(
      "resize",
      () => {
        event.resize();
      },
      false,
    );
  },
  // 悬浮窗配置
  tooltip: {
    trigger: "axis",
    axisPointer: {
      type: "line",
    },
    borderColor: "transparent",
    textStyle: {
      color: "#fff", //设置文字颜色
    },
    backgroundColor: "#05164d",
  },
  tooltips: {
    trigger: "axis",
    axisPointer: {
      type: "line",
    },
    borderColor: "transparent",
    textStyle: {
      color: "#fff", //设置文字颜色
    },
    backgroundColor: "#05164d",
    // 此函数用于格式化图表中的标签
    formatter: function (val) {
      // 初始化返回的字符串，添加第一个标签的名称
      let string = val[0].name + "<br>";
      // 遍历标签数组，为每个标签生成对应的 HTML 字符串
      val.forEach((v) => {
        // 为每个标签生成包含标记、轴值和实际值的 flex 容器，并添加到字符串中
        string += `<div style='display: flex;align-items: center;justify-content: space-between;'><span>${v.marker}${v.seriesName}</span>&nbsp; &nbsp; <span style='font-weight: 700;'>${v.value || 0}%</span></div>`;
      });
      // 返回构建好的 HTML 字符串
      return string;
    },
  },

  // 图表位置修改
  grid: {
    //位置修改
    left: "3%",
    right: "3%",
    bottom: "10%",
    top: "15%",
    containLabel: true,
  },
  // 坐标刻度文本样式
  axisLabel: (v = "{value}") => ({
    //刻度文本
    show: true,
    textStyle: {
      color: "#fff",
    },
    formatter: v,
  }),
  // 刻度线样式
  splitLine: {
    //刻度线
    show: true,
    lineStyle: {
      color: "#799CB3",
      opacity: 0.24,
      type: "dashed",
    },
  },
};
// 满意度情况
export const satisfactionSituation = (yearList) => {
  return yearList
    .map((year) => ({
      name: `${year}年`,
      client: "0%",
      staff: "0%",
    }))
    .reverse();
};
// 各类市场份额
export const marketShareByCategory = (yearList) => {
  return yearList
    .map((year) => ({
      name: `${year}年`,
      user: "0",
      gprs: "0",
      homeWideClient: "0",
      gigabitSubscriber: "0",
      communicationUser: "0",
      governmentAndEnterpriseMarketIncome: "0",
      income: "0",
    }))
    .reverse();
};
// 收入利润完成情况
export const completionOfRevenueAndProfit = (yearList) => {
  return yearList
    .map((year) => ({
      name: `${year}年`,
      income: "0", //收入
      totalProfit: "0", //利润总额
      profitToRevenueRatio: "0%", //利润收入率
      productivityPerWorker: "0%", //人均劳动生产率
      profitRatePerCapitaOnLabor: "0%", //人均劳动利润率
    }))
    .reverse();
};
// 业务条线
export const defaultServiceLineData = [
  {
    name: "市场", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
  {
    name: "政企", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
  {
    name: "网络", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
  {
    name: "工程", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
  {
    name: "采购", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
  {
    name: "综合", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
];
// 七大审计内容
export const auditContent = [
  {
    name: "落实党和国家政策", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
  {
    name: "执行省公司战略举措", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
  {
    name: "经营决策", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
  {
    name: "会计信息质量", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
  {
    name: "内部控制", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
  {
    name: "廉洁从业", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
  {
    name: "审计整改", //刻度
    quantity: "0", //数量
    money: "0", //金额
  },
];
// 调查问卷项得分结果
export const defaultSurveyQuestionnaire = [
  {
    name: "问责落实", //刻度
    value: 0,
  },
  {
    name: "个人廉洁从业", //刻度
    value: 0,
  },
  {
    name: "公司廉洁从业", //刻度
    value: 0,
  },
  {
    name: "守法守规", //刻度
    value: 0,
  },
  {
    name: "三重一大决策", //刻度
    value: 0,
  },
  {
    name: "内控制度执行", //刻度
    value: 0,
  },
  {
    name: "落实国家政策", //刻度
    value: 0,
  },
  {
    name: "重大决策结果", //刻度
    value: 0,
  },
  {
    name: "落实集团战略", //刻度
    value: "0",
  },
  {
    name: "网络能力建设", //刻度
    value: 0,
  },
  {
    name: "经营绩效真实性", //刻度
    value: 0,
  },
  {
    name: "客户保有拓展", //刻度
    value: 0,
  },
  {
    name: "总体经营业绩", //刻度
    value: 0,
  },
  {
    name: "发展战略", //刻度
    value: 0,
  },
  {
    name: "重指标轻管理", //刻度
    value: 0,
  },
  {
    name: "CHBN融合", //刻度
    value: 0,
  },
  {
    name: "重点改革成效", //刻度
    value: 0,
  },
  {
    name: "可持续发展", //刻度
    value: 0,
  },
  {
    name: "区域市场竞争", //刻度
    value: 0,
  },
  {
    name: "资源配置", //刻度
    value: 0,
  },
];

// 有待提升的方面
export const defaultToBeImproved = [
  {
    name: "企业运行效率", //刻度
    value: 0,
  },
  {
    name: "能力构建", //刻度
    value: 0,
  },
  {
    name: "发展动能", //刻度
    value: 0,
  },
  {
    name: "支撑质量", //刻度
    value: 0,
  },
  {
    name: "基础管理", //刻度
    value: 0,
  },
  {
    name: "客服服务", //刻度
    value: 0,
  },
];
